﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Velocity4Net.Ctx;
using Velocity4Net.Util.Introspection;

namespace Velocity4Net.App.Events
{

    /**
     * Defines the execution strategy for invalidGetMethod
     */
    class InvalidSetMethodExecutor : EventHandlerMethodExecutor
    {
        private IContext context;
        private String leftreference;
        private String rightreference;
        private Info info;

        private bool result;

        public InvalidSetMethodExecutor(
                IContext context,
                String leftreference,
                String rightreference,
                Info info)
        {
            this.context = context;
            this.leftreference = leftreference;
            this.rightreference = rightreference;
            this.info = info;
        }

        /**
         * Call the method invalidSetMethod()
         *  
         * @param handler call the appropriate method on this handler
         */
        public void execute(EventHandler handler)
        {
            result = ((InvalidReferenceEventHandler)handler).invalidSetMethod(
                    context, leftreference, rightreference, info);
        }

        public Object getReturnValue()
        {
            return null;
        }

        public bool isDone()
        {
            return result;
        }

    }

}
